<template>
	<div class="tixianmingxi-box">
		<ul class="tixianlist">
			<li class="tixian-item" v-for="item in mingxilist">
				<h4 class="hhmoney" v-html="item.tx_view+'<span>'+item.money+'元</span>'">提现至支付宝（12345678</h4>
				<!--<p class="tixianloding" v-html="new Date(Number(item.add_time)*1000).Format('yyyy-MM-dd hh:mm:ss')">2018-09-19 11:38:22</p><p id="ztpd" style="font-size: 13px;float: right;margin-top: -0.35rem;">{{message}}</p>-->
				<p class="tixianloding" v-html="new Date(Number(item.add_time)*1000).Format('yyyy-MM-dd hh:mm:ss')+'<span>'+item.states+'</span>'">2018-09-19 11:38:22<span>提现中</span></p>
			</li>
		</ul>
	</div>
</template>

<script>
	export default{
		data () {
			return{
				user:0,
				page:1,
				pagenum:0,
				mingxilist:[],
				scrollstatu:true,
				message:''
			}
		},
		created:function(){
			this.user=localStorage.getItem("nt_user");
			this.mingxiajax();
		},
		methods:{
			mingxiajax:function(){
				var self=this;
				$.ajax({
					type:"get",
					url:furl+"index.php?app=ajax_epay&act=withdraw_list",
					data:{'token':self.user,'page':self.page},
					dataType:'json',
					success:function(res){
						if(res.done){
							self.mingxilist=self.mingxilist.concat(res.retval.list);
							self.pagenum=res.retval.page.page_count;
							self.scrollstatu=true;
							self.zhuantai = res.retval.list
							var arr = self.zhuantai;
							for ( var i = 0; i <arr.length; i++){
								if (arr[i].states == 71) {
									self.message = '提现成功'
								}else{
									self.message = '提现审核中'
								}
							}
						}
					}
				});
			},
			scrollajax:function(){
				if(this.scrollstatu){
					if(this.page+1<=this.pagenum){
						var dSH=$(document).scrollTop()
						var dH=$(document).height()
						var wH=$(window).height()
						if((dSH+wH)/dH>0.8){
							this.scrollstatu=false;
							this.page=this.page+1;
							console.log(this.page);
							this.mingxiajax();
						}
					}
					
				}
			}
		},
		mounted:function(){
			var self=this;
			window.addEventListener("scroll",self.scrollajax);
		},
		destroyed:function () {
		    this.scrollstatu = false;
		}
	}
</script>

<style>
	.tixianmingxi-box{font-size:0;}
	.tixianlist{padding-left: 0.32rem;padding-right: 0.32rem;}
	.tixian-item{padding-top:0.2rem;padding-bottom: 0.2rem;border-bottom: 1px solid #eee;}
	.tixian-item>h4{font-size:0.28rem;color:#2B2B2B;font-weight:600;line-height: 0.54rem;height:0.54rem;}
	.tixian-item>h4>span{float:right;}
	.tixian-item>p{font-size:0.24rem;color:#999999;line-height: 0.45rem;}
	.tixian-item>p>span{float:right;}
</style>